package cn.xiaoliu.org.service.impl;

import cn.xiaoliu.basic.service.impl.BaseServiceImpl;
import cn.xiaoliu.org.domain.DictionaryType;
import cn.xiaoliu.org.mapper.DictionaryMapper;
import cn.xiaoliu.org.mapper.DictionaryTypeMapper;
import cn.xiaoliu.org.service.IDictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class DictionaryTypeServiceImpl extends BaseServiceImpl<DictionaryType> implements IDictionaryTypeService{

    @Autowired
    private DictionaryTypeMapper dictionaryTypeMapper;
    @Autowired
    private DictionaryMapper dictionaryMapper;

    @Override
    @Transactional
    public void remove(Long id) {
        dictionaryTypeMapper.delete(id);
        dictionaryMapper.deleteById(id);
    }

    @Override
    @Transactional
    public void pachRemove(List<Long> ids) {
        dictionaryTypeMapper.pachRemove(ids);
        dictionaryMapper.pachRemoveById(ids);
    }
}
